home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 3 / CD ACTUAL 3.iso / linux / docs / linux-do / network- / nag-1.002 / nag-1 / TheGuide / Makefile < prev   
Encoding:
Makefile  |  1994-08-18  |  5.3 KB  |  190 lines

  1. ############################################################# 
  2. # Makefile for the Linux Network Administrators' Guide
  3. # Copyright (C) Olaf Kirch, 1992, 1993, 1994.
  4. #
  5. #############################################################
  6. VERSION=1.0
  7.  
  8. #############################################################
  9. # set this to a4 or legal, depending on the paper size your
  10. # printer understands. Currently, the only effect of this is
  11. # that dvips will be forced to output the appropiate size.
  12. # The paper size is _not_ given to latex.
  13. #############################################################
  14. PAPER=letter
  15.  
  16. #############################################################
  17. # Get the filesets for the various format distributions
  18. #############################################################
  19. include FILESETS
  20.  
  21. #############################################################
  22. # Commands
  23. # Note that for making the distribution, you must have
  24. # GNU tar (or any other tar that supports the -T option)
  25. #############################################################
  26. TEXIFY      = texify
  27. MAKEINFO  = makeinfo
  28. TEXI2ROFF = texi2roff
  29. TAR      = tar
  30. SHELL      = /bin/sh
  31.  
  32. CRUFT      = *.aux *.toc *.lof *.log
  33.  
  34. #############################################################
  35. # Rules section
  36. #############################################################
  37. .SUFFIXES: .fig .eepic .epsf .idx .ind
  38.  
  39. all:    dvi    # default target
  40.  
  41. clean: cleantex cleanps cleaninfo cleanroff
  42.     rm -f aux/*/* nag.dvi nagps.dvi index/*
  43.  
  44. #############################################################
  45. # Targets relating to TeX/DVI/PS
  46. #############################################################
  47. dvi:    nag.dvi
  48. psdvi:    nagps.dvi
  49. ps:    nagps.dvi
  50.     dvips -t $(PAPER) nagps.dvi -o nag.ps
  51.  
  52. nag.dvi:$(TEXDEP)
  53.     @if [ ! -f aux/dvi/nag.aux -a ! -f .recurse ]; then\
  54.         echo;\
  55.         echo "I see you're building $@ for the first time.";\
  56.         echo "I will therefore run LaTeX three times...";\
  57.         echo "(Maybe you would want to have a coffee now?)";\
  58.         echo;\
  59.         sleep 1;\
  60.         touch .recurse;\
  61.         make $@; touch $(TEXDEP); \
  62.         make $@; touch $(TEXDEP); \
  63.         rm -f .recurse; \
  64.     fi
  65.     TEXINPUTS=styles/latex:aux/dvi:.//:$$TEXINPUTS:    \
  66.     latex nag.tex;
  67.     -mv $(CRUFT) aux/dvi
  68.     @if [ -f nag.idx ]; then \
  69.         mv nag.idx index && make index/nag.ind; \
  70.     fi
  71.  
  72. nagps.dvi: $(PSDEP)
  73.     @if [ ! -f aux/dvips/nagps.aux -a ! -f .recurse ]; then\
  74.         echo;\
  75.         echo "I see you're building $@ for the first time.";\
  76.         echo "I will therefore run LaTeX three times...";\
  77.         echo "(Maybe you would want to have a coffee now?)";\
  78.         echo;\
  79.         sleep 1;\
  80.         touch .recurse;\
  81.         make $@; touch $(PSDEP); \
  82.         make $@; touch $(PSDEP); \
  83.         rm -f .recurse; \
  84.     fi
  85.     TEXINPUTS=styles/latex:aux/dvips/:.//:$$TEXINPUTS: \
  86.     latex nagps.tex;
  87.     -mv $(CRUFT) aux/dvips
  88.     @if [ -f nagps.idx ]; then \
  89.         mv nagps.idx index && make index/nagps.ind; \
  90.     fi
  91.  
  92. spollchuck:
  93.     echo "Checking for misspellings (not a big win, tho)"
  94.     ../bin/makewords $(TEXALL)
  95.  
  96. cleantex:
  97.     rm -f nag.dvi index/nag.* aux/dvi/*
  98.  
  99. cleanps:
  100.     rm -f nagps.dvi nag.ps index/nagps.* aux/dvips/*
  101.  
  102. #############################################################
  103. # Targets relating to TeXinfo/Info
  104. #############################################################
  105. texi:    net.texi
  106.  
  107. info:     netguide
  108.  
  109. netguide:$(TEXI)
  110.     $(MAKEINFO) nag.texi
  111.  
  112. net.texi:$(TEXIDEP)
  113.     $(TEXIFY) net.tex
  114.     $(TEXIFY) net.tex
  115.  
  116. cleaninfo:
  117.     rm -f netguide netguide-[0-9] netguide-[0-9][0-9] \
  118.         net.texi net.auxi net.ff net.menu aux/info/*
  119.  
  120. #############################################################
  121. # Targets relating to groff/ASCII. These targets require
  122. # that you have LoTeX-0.9
  123. #############################################################
  124. roff:    $(ROFF)
  125. ascii:    nag.ascii
  126.  
  127. nag.mm:$(ROFFDEP)
  128.     @echo "Making the GNU roff version... this may take between"
  129.     @echo "a few minutes (or longer)."
  130.     LOTEXINCLUDES=aux/mm:.//: LOTEXSTYLES=styles/lotex lotex nagmm
  131.     mv nagmm.mm nag.mm
  132.     mv *.auxl aux/mm
  133.  
  134. nag.ascii:$(ROFF)
  135.     rm -f *.qrf
  136.     @$(MAKE) rungroff
  137.     makeroffidx net.idxl
  138.     @$(MAKE) rungroff
  139.  
  140. rungroff:
  141.     (groff -t -Tascii -mgm nag.mm | colcrt - > nag.ascii) 2>&1 | \
  142.         tee nagasc.log
  143.  
  144. cleanroff:
  145.     rm -f nag.mm nag.ascii aux/mm/* index/nagmm.*
  146.  
  147. #############################################################
  148. # Targets relating to fig picture conversion
  149. #############################################################
  150. .fig.eepic:
  151.     fig2dev -Leepic $< > $@
  152. .fig.epsf:
  153.     fig2dev -Lps $< > $@
  154.  
  155. #############################################################
  156. # Targets relating to index generation
  157. #############################################################
  158. .idx.ind:
  159.     @echo Generating index for $?.dvi
  160.     makeindex $<
  161.  
  162. #############################################################
  163. # Make distribution files
  164. #############################################################
  165. dist:    src-dist dvi-dist ps-dist roff-dist
  166.  
  167. src-dist:
  168.     @ls $(SRCDIST)
  169.  
  170. dvi-dist:dvi
  171.     @ls $(DVIDIST)  | sed "s/^/.\/netguide\//" > MANIFEST
  172.     -cd ..; $(TAR) -cvf - -T netguide/MANIFEST |\
  173.         gzip > nagdvi-$(VERSION).tgz
  174.  
  175. ps-dist: ps
  176.     @ls $(PSDIST)   | sed "s/^/.\/netguide\//" > MANIFEST
  177.     -cd ..; $(TAR) -cvf - -T netguide/MANIFEST |\
  178.         gzip > nagps-$(VERSION).tgz
  179.  
  180. texi-dist:texi
  181.     @ls $(TEXIDIST) | sed "s/^/.\/netguide\//" > MANIFEST
  182.     -cd ..; $(TAR) -cvf - -T netguide/MANIFEST |\
  183.         gzip > nagtexi-$(VERSION).tgz
  184.  
  185. roff-dist:roff
  186.     @ls $(ROFFDIST) | sed "s/^/.\/netguide\//" > MANIFEST
  187.     -cd ..; $(TAR) -cvf - -T netguide/MANIFEST |\
  188.         gzip > nagroff-$(VERSION).tgz
  189.  
  190.